/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Generation.Production.impl;

import EA_Model.IEC61970.Core.impl.PowerSystemResourceImpl;

import EA_Model.IEC61970.Domain.ActivePower;

import EA_Model.IEC61970.Generation.Production.CogenerationPlant;
import EA_Model.IEC61970.Generation.Production.ProductionPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Cogeneration Plant</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.CogenerationPlantImpl#getCogenHPSendoutRating <em>Cogen HP Sendout Rating</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.CogenerationPlantImpl#getCogenHPSteamRating <em>Cogen HP Steam Rating</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.CogenerationPlantImpl#getCogenLPSendoutRating <em>Cogen LP Sendout Rating</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.CogenerationPlantImpl#getCogenLPSteamRating <em>Cogen LP Steam Rating</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.CogenerationPlantImpl#getRatedP <em>Rated P</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CogenerationPlantImpl extends PowerSystemResourceImpl implements CogenerationPlant {
	/**
	 * The cached value of the '{@link #getCogenHPSendoutRating() <em>Cogen HP Sendout Rating</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCogenHPSendoutRating()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float cogenHPSendoutRating;

	/**
	 * The cached value of the '{@link #getCogenHPSteamRating() <em>Cogen HP Steam Rating</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCogenHPSteamRating()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float cogenHPSteamRating;

	/**
	 * The cached value of the '{@link #getCogenLPSendoutRating() <em>Cogen LP Sendout Rating</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCogenLPSendoutRating()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float cogenLPSendoutRating;

	/**
	 * The cached value of the '{@link #getCogenLPSteamRating() <em>Cogen LP Steam Rating</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCogenLPSteamRating()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float cogenLPSteamRating;

	/**
	 * The cached value of the '{@link #getRatedP() <em>Rated P</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRatedP()
	 * @generated
	 * @ordered
	 */
	protected ActivePower ratedP;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CogenerationPlantImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ProductionPackage.Literals.COGENERATION_PLANT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getCogenHPSendoutRating() {
		if (cogenHPSendoutRating != null && cogenHPSendoutRating.eIsProxy()) {
			InternalEObject oldCogenHPSendoutRating = (InternalEObject)cogenHPSendoutRating;
			cogenHPSendoutRating = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldCogenHPSendoutRating);
			if (cogenHPSendoutRating != oldCogenHPSendoutRating) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.COGENERATION_PLANT__COGEN_HP_SENDOUT_RATING, oldCogenHPSendoutRating, cogenHPSendoutRating));
			}
		}
		return cogenHPSendoutRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetCogenHPSendoutRating() {
		return cogenHPSendoutRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCogenHPSendoutRating(EA_Model.IEC61970.Domain.Float newCogenHPSendoutRating) {
		EA_Model.IEC61970.Domain.Float oldCogenHPSendoutRating = cogenHPSendoutRating;
		cogenHPSendoutRating = newCogenHPSendoutRating;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.COGENERATION_PLANT__COGEN_HP_SENDOUT_RATING, oldCogenHPSendoutRating, cogenHPSendoutRating));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getCogenHPSteamRating() {
		if (cogenHPSteamRating != null && cogenHPSteamRating.eIsProxy()) {
			InternalEObject oldCogenHPSteamRating = (InternalEObject)cogenHPSteamRating;
			cogenHPSteamRating = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldCogenHPSteamRating);
			if (cogenHPSteamRating != oldCogenHPSteamRating) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.COGENERATION_PLANT__COGEN_HP_STEAM_RATING, oldCogenHPSteamRating, cogenHPSteamRating));
			}
		}
		return cogenHPSteamRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetCogenHPSteamRating() {
		return cogenHPSteamRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCogenHPSteamRating(EA_Model.IEC61970.Domain.Float newCogenHPSteamRating) {
		EA_Model.IEC61970.Domain.Float oldCogenHPSteamRating = cogenHPSteamRating;
		cogenHPSteamRating = newCogenHPSteamRating;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.COGENERATION_PLANT__COGEN_HP_STEAM_RATING, oldCogenHPSteamRating, cogenHPSteamRating));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getCogenLPSendoutRating() {
		if (cogenLPSendoutRating != null && cogenLPSendoutRating.eIsProxy()) {
			InternalEObject oldCogenLPSendoutRating = (InternalEObject)cogenLPSendoutRating;
			cogenLPSendoutRating = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldCogenLPSendoutRating);
			if (cogenLPSendoutRating != oldCogenLPSendoutRating) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.COGENERATION_PLANT__COGEN_LP_SENDOUT_RATING, oldCogenLPSendoutRating, cogenLPSendoutRating));
			}
		}
		return cogenLPSendoutRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetCogenLPSendoutRating() {
		return cogenLPSendoutRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCogenLPSendoutRating(EA_Model.IEC61970.Domain.Float newCogenLPSendoutRating) {
		EA_Model.IEC61970.Domain.Float oldCogenLPSendoutRating = cogenLPSendoutRating;
		cogenLPSendoutRating = newCogenLPSendoutRating;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.COGENERATION_PLANT__COGEN_LP_SENDOUT_RATING, oldCogenLPSendoutRating, cogenLPSendoutRating));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getCogenLPSteamRating() {
		if (cogenLPSteamRating != null && cogenLPSteamRating.eIsProxy()) {
			InternalEObject oldCogenLPSteamRating = (InternalEObject)cogenLPSteamRating;
			cogenLPSteamRating = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldCogenLPSteamRating);
			if (cogenLPSteamRating != oldCogenLPSteamRating) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.COGENERATION_PLANT__COGEN_LP_STEAM_RATING, oldCogenLPSteamRating, cogenLPSteamRating));
			}
		}
		return cogenLPSteamRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetCogenLPSteamRating() {
		return cogenLPSteamRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCogenLPSteamRating(EA_Model.IEC61970.Domain.Float newCogenLPSteamRating) {
		EA_Model.IEC61970.Domain.Float oldCogenLPSteamRating = cogenLPSteamRating;
		cogenLPSteamRating = newCogenLPSteamRating;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.COGENERATION_PLANT__COGEN_LP_STEAM_RATING, oldCogenLPSteamRating, cogenLPSteamRating));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivePower getRatedP() {
		if (ratedP != null && ratedP.eIsProxy()) {
			InternalEObject oldRatedP = (InternalEObject)ratedP;
			ratedP = (ActivePower)eResolveProxy(oldRatedP);
			if (ratedP != oldRatedP) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.COGENERATION_PLANT__RATED_P, oldRatedP, ratedP));
			}
		}
		return ratedP;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivePower basicGetRatedP() {
		return ratedP;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRatedP(ActivePower newRatedP) {
		ActivePower oldRatedP = ratedP;
		ratedP = newRatedP;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.COGENERATION_PLANT__RATED_P, oldRatedP, ratedP));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_SENDOUT_RATING:
				if (resolve) return getCogenHPSendoutRating();
				return basicGetCogenHPSendoutRating();
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_STEAM_RATING:
				if (resolve) return getCogenHPSteamRating();
				return basicGetCogenHPSteamRating();
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_SENDOUT_RATING:
				if (resolve) return getCogenLPSendoutRating();
				return basicGetCogenLPSendoutRating();
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_STEAM_RATING:
				if (resolve) return getCogenLPSteamRating();
				return basicGetCogenLPSteamRating();
			case ProductionPackage.COGENERATION_PLANT__RATED_P:
				if (resolve) return getRatedP();
				return basicGetRatedP();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_SENDOUT_RATING:
				setCogenHPSendoutRating((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_STEAM_RATING:
				setCogenHPSteamRating((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_SENDOUT_RATING:
				setCogenLPSendoutRating((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_STEAM_RATING:
				setCogenLPSteamRating((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case ProductionPackage.COGENERATION_PLANT__RATED_P:
				setRatedP((ActivePower)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_SENDOUT_RATING:
				setCogenHPSendoutRating((EA_Model.IEC61970.Domain.Float)null);
				return;
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_STEAM_RATING:
				setCogenHPSteamRating((EA_Model.IEC61970.Domain.Float)null);
				return;
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_SENDOUT_RATING:
				setCogenLPSendoutRating((EA_Model.IEC61970.Domain.Float)null);
				return;
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_STEAM_RATING:
				setCogenLPSteamRating((EA_Model.IEC61970.Domain.Float)null);
				return;
			case ProductionPackage.COGENERATION_PLANT__RATED_P:
				setRatedP((ActivePower)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_SENDOUT_RATING:
				return cogenHPSendoutRating != null;
			case ProductionPackage.COGENERATION_PLANT__COGEN_HP_STEAM_RATING:
				return cogenHPSteamRating != null;
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_SENDOUT_RATING:
				return cogenLPSendoutRating != null;
			case ProductionPackage.COGENERATION_PLANT__COGEN_LP_STEAM_RATING:
				return cogenLPSteamRating != null;
			case ProductionPackage.COGENERATION_PLANT__RATED_P:
				return ratedP != null;
		}
		return super.eIsSet(featureID);
	}

} //CogenerationPlantImpl
